﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

using Urgencias.Controlador;

namespace Urgencias.Vista
{
    public partial class ListadoBoxesUC : UserControl
    {
        public ListadoBoxesUC()
        {
            InitializeComponent();
        }

        private void ListadoInsumosUC_Load(object sender, EventArgs e)
        {
            using (Conexion.Instance.Con) //With this, you don't have to close the connection
            {
                
                SqlDataAdapter adapter = new SqlDataAdapter("select * from BOX", Conexion.Instance.Con);
                DataSet ds = new DataSet();
                adapter.Fill(ds, "BOX");
                GridViewBox.DataSource = ds;
                GridViewBox.DataMember = "BOX";
            }
        }
    }
}
